#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>

int main()
{
    pid_t id=fork();
    if(id==0)
    { 
        printf("I am child process\n");
        sleep(5);
        exit(111);
    }

    int status=0;
    pid_t ret=waitpid(id,&status,0);
    printf("process exit code:%d,process exit signal:%d\n",WEXITSTATUS(status),WTERMSIG(status));
    return 0;
}